package cn.stylefeng.guns.modular.rest;


import cn.stylefeng.guns.modular.school.model.params.StudentInfoParam;
import cn.stylefeng.guns.modular.school.service.StudentInfoService;
import cn.stylefeng.guns.sys.modular.system.model.UserDto;
import cn.stylefeng.guns.sys.modular.system.service.UserService;
import cn.stylefeng.roses.core.base.controller.BaseController;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 绑定控制器
 *
 * @author
 * @Date 2019-11-18 13:24:11
 */
@RestController
@RequestMapping("/miniprogramApi/user")
public class ApiUserController extends BaseController {
    private final UserService userService;
    private final StudentInfoService studentInfoService;

    public ApiUserController(UserService userService, StudentInfoService studentInfoService) {
        this.userService = userService;
        this.studentInfoService = studentInfoService;
    }


    @RequestMapping("/add")
    @Transactional
    public ResponseData addUser( UserDto user, StudentInfoParam studentInfoParam) {
        //this.userService.addUser(user);

        studentInfoService.add(studentInfoParam);
        return SUCCESS_TIP;
    }
}


